﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace ScsmIncidentLibrary
{
    /// <summary>
    /// Provides functionality to Service Manage Incidents
    /// </summary>
    [ServiceContract(Namespace = "http://servicemanager.incidents.dallascowboys.net")]
    public interface IIncident
    {
        /// <summary>
        /// Creates an incident given minimal input
        /// </summary>
        /// <param name="userDomainNameForIncidentCreatedBy">Name of domain for user creating incident that should also be a configuration item in Service Manager.</param>
        /// <param name="userNameForIncidentCreatedBy">User name for user creating incident that should also be a configuration item in Service Manager</param>
        /// <param name="title">Incident title.</param>
        /// <param name="description">Incident description.</param>
        /// <returns>Error message if exception occurs.</returns>
        [OperationContract]
        string Create(string userDomainNameForIncidentCreatedBy, string userNameForIncidentCreatedBy, string title, string description);

        /// <summary>
        /// Sets incident status to Closed if not already closed and current user is the affected user.
        /// </summary>
        /// <param name="currentUserDomainName">Domain name of user trying to close incident.</param>
        /// <param name="currentUserName">Username of user trying to close incident.</param>
        /// <param name="incidentId">Id of incident to close.</param>
        /// <returns>Error message if exception occurs.</returns>
        [OperationContract]
        string Close(string currentUserDomainName, string currentUserName, string incidentId);

        /// <summary>
        /// Sets incident status to Active if not already closed and current user is the affected user.
        /// </summary>
        /// <param name="currentUserDomainName">Domain name of user trying to activate incident.</param>
        /// <param name="currentUserName">Username of user trying to activate incident.</param>
        /// <param name="incidentId">Id of incident to close.</param>
        /// <returns>Error message if exception occurs.</returns>
        [OperationContract]
        string Activate(string currentUserDomainName, string currentUserName, string incidentId);

        /// <summary>
        /// Returns help for the service methods exposed by service.
        /// </summary>
        /// <returns></returns>
        [OperationContract]
        string Help();
    }
}
